Skip to content

feat(shell): improve shell detection with direct environment checks#24

Merged
benbenbang merged 1 commit into
mainfrom
feat/detect_anchor
Mar 27, 2026
Merged

feat(shell): improve shell detection with direct environment checks#24
benbenbang merged 1 commit into
mainfrom
feat/detect_anchor

Conversation

@benbenbang

Copy link
Copy Markdown
Owner

This commit enhances the shell auto-detection logic to be more reliable by checking shell-specific environment variables before falling back to the generic SHELL variable. The changes prioritize direct shell indicators over the login shell setting.

Shell detection improvements:

  • Added direct detection for Fish shell via $FISH_VERSION environment variable, which is set by Fish itself and is more reliable than parsing $SHELL
  • Added direct detection for Nushell via $NU_VERSION environment variable
  • Reordered detection logic to check shell-specific variables first ($FISH_VERSION, $NU_VERSION) before falling back to $SHELL and $PSModulePath
  • Added inline documentation explaining the detection order and rationale for each check

This commit enhances the shell auto-detection logic to be more reliable by checking shell-specific environment variables before falling back to the generic SHELL variable. The changes prioritize direct shell indicators over the login shell setting.

**Shell detection improvements:**
* Added direct detection for Fish shell via `$FISH_VERSION` environment variable, which is set by Fish itself and is more reliable than parsing `$SHELL`
* Added direct detection for Nushell via `$NU_VERSION` environment variable
* Reordered detection logic to check shell-specific variables first (`$FISH_VERSION`, `$NU_VERSION`) before falling back to `$SHELL` and `$PSModulePath`
* Added inline documentation explaining the detection order and rationale for each check
@benbenbang
benbenbang enabled auto-merge (squash) March 27, 2026 19:32
@github-actions github-actions Bot added enhancement New feature or request triage labels Mar 27, 2026
@benbenbang
benbenbang merged commit e4306d7 into main Mar 27, 2026
2 checks passed
@benbenbang
benbenbang deleted the feat/detect_anchor branch March 27, 2026 19:33
@ptah-technical-app

Copy link
Copy Markdown

🎉 This PR is included in version 2.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant